-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define how "Assert:" works #98
Conversation
See #87 for direct inspiration, though we’ve been using this here and there for a while now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add something like
If an assertion ends up being violated, that indicates a bug in the specification, and that subsequent steps in the algorithm are unlikely to work as expected. (It does not indicate any specific runtime behavior such as throwing an exception.)
infra.bs
Outdated
<h3 id=assertions>Assertions</h3> | ||
|
||
<p>To improve readability, it can sometimes help to add assertions to algorithms, stating | ||
invariants. To do this, write "<code>Assert: </code>", followed by a statement that must be true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be <code>
; just normal font is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Elsewhere we say that strings should use code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I guess we haven't done it for algorithm keywords per se.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this isn't a string in the sense of the data type.
Shall I add that as a note? |
Not sure if it's a note or normative; I could go either way. |
Added a bit. |
See #87 for direct inspiration, though we’ve been using this here and
there for a while now.
Preview | Diff